import time
class publishutilitie:

    def getLocationTime(timeformat='%Y-%m-%d %X'):
        return time.strftime( timeformat, time.localtime( time.time() ) )
    
    def downHtmlFromUrl(self,url,downFilePath,decode='',downFileName=''):
        """"""
        #print('down -' + url)
        response = urllib.request.urlopen(url)
        content = response.read()
        if(self.decode):
            content = content.decode(decode)
        filePath = os.path.join(downFilePath,downFileName)
        f=open(filePath,'w', encoding=decode)
        f.write(content)
        f.close()
        